package com.hejjon.knowledgebase.util;

import org.apache.commons.beanutils.BeanUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * @author:
 * @date: 2022-12-08 11:57:56
 * @since: 1.0
 */
public class BeanMapUtil {

    /**
     *  bean 转 map
     * @param object bean
     * @return HashMap
     */
    public static Map<String, String> bean2Map(Object object) {
        try {
            return BeanUtils.describe(object);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return new HashMap<>();
    }


}
